const path = require("path");
function resolve(dir) {
  return path.join(__dirname, dir);
}

module.exports = {
  // 选项...
  baseUrl: "./",
  outputDir: "dist",
  assetsDir: "assets",
  indexPath: "index.html",
  filenameHashing: true,
  pages: undefined,
  lintOnSave: true,
  runtimeCompiler: false,
  transpileDependencies: [],
  productionSourceMap: false,
  crossorigin: undefined,
  integrity: false,
  chainWebpack: config => {
    config.resolve.alias.set("styles", resolve("src/assets/styles"));
  },
  devServer: {
    //代理
    host: "localhost",
    port: 8088, // 端口号
    https: false, // https:{type:Boolean}
    open: false, //配置自动启动浏览器
    // proxy: 'http://localhost:4000' // 配置跨域处理,只有一个代理
    proxy: {
      "/api": {
        target: "http://localhost:8088",
        pathRewrite: {
          "^/api": "/static/mock"
        }
      }
    }
  }
};
